package com.ruoyi.factory.manpower.controller;

import com.ruoyi.factory.manpower.service.OverTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: LiuJiaji
 * @date: 2025/8/8 15:39
 * @description: TODO 加班 同步友空间加班信息到erp
 * @param:
 * @return:
 **/
@EnableScheduling
@RestController("overTimeController")
@RequestMapping("/api/overTimeController")
public class OverTimeController {

    @Autowired
    private OverTimeService overTimeService;

    /**
     * @author: LiuJiaji
     * @date: 2025/8/8 15:40
     * @description: TODO 友空间加班信息同步到erp
     * @param:
     * @return:
     **/
    @PostMapping("/ykjovertimetoerp")
    public void ykjovertimetoerp(){

        overTimeService.ykjovertimetoerp();
    }

    /**
     * @author: LiuJiaji
     * @date: 2025/9/2 14:49
     * @description: TODO 23点20执行
     * @param:
     * @return:
     **/
//    @Scheduled(cron="0 0,20 23 * * ?")
    public void ykjovertimetoerp2(){

        overTimeService.ykjovertimetoerp();
    }

}
